package com.lightning.modules.validator.validators;
public class LengthValidator extends AbstractValidator {
	public LengthValidator() {
		setName("length");
	}

	@Override
	public boolean validator(Object pojo) {
		String[] pars = super.getParmeter().split(":");
		int mix = Integer.parseInt(pars[0]);
		int max = Integer.parseInt(pars[1]);
		if (mix > -1 && pojo.toString().length() < mix) {
			return false;
		} else if (max > -1 && pojo.toString().length() > max) {
			return false;
		}
		return true;
	}
}
